import 'package:flutter/material.dart';

// import '../Search.dart';
class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      child: Column(
        //crossAxisAlignment: CrossAxisAlignment.center,
        // mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Row(
            children: [
              RaisedButton(
                child: Text("跳转搜索页面"),
                onPressed: () {
                  //基本路由跳转需要引入页面
                  // Navigator.of(context)
                  //     .push(MaterialPageRoute(builder: (context) => SerarchPage()));
                  Navigator.pushNamed(context, '/search',
                      arguments: {'id': 123});
                },
              ),
              RaisedButton(
                child: Text("跳转商品页面"),
                onPressed: () {
                  //基本路由跳转需要引入页面
                  // Navigator.of(context)
                  //     .push(MaterialPageRoute(builder: (context) => SerarchPage()));
                  Navigator.pushNamed(context, '/product');
                },
              ),
            ],
          ),
          Row(
            children: [
              RaisedButton(
                child: Text("跳转AppBar"),
                onPressed: () {
                  Navigator.pushNamed(context, '/appBarCustom');
                },
              ),
              RaisedButton(
                child: Text("跳转TabBar的另一种方式"),
                onPressed: () {
                  Navigator.pushNamed(context, '/tabbarController');
                },
              ),
            ],
          ),
          Row(
            children: [
              RaisedButton(
                child: Text("跳转按钮页面"),
                onPressed: () {
                  Navigator.pushNamed(context, '/button');
                },
              ),
              RaisedButton(
                child: Text("跳转TextField页面"),
                onPressed: () {
                  Navigator.pushNamed(context, '/textFieldPage');
                },
              )
            ],
          ),
          Row(
            children: [
              RaisedButton(
                child: Text("卡片布局和动态数据"),
                onPressed: () {
                  Navigator.pushNamed(context, '/card');
                },
              ),
              RaisedButton(
                child: Text("wrap流布局"),
                onPressed: () {
                  Navigator.pushNamed(context, '/wrap');
                },
              )
            ],
          ),
          Row(
            children: [
              RaisedButton(
                child: Text("GridViewbuilder"),
                onPressed: () {
                  Navigator.pushNamed(context, '/gridViewbuilder');
                },
              ),
              RaisedButton(
                child: Text("GridViewcount"),
                onPressed: () {
                  Navigator.pushNamed(context, '/gridViewcount');
                },
              )
            ],
          ),
          Row(
            children: [
              RaisedButton(
                child: Text("点击按钮改变text文字"),
                onPressed: () {
                  Navigator.pushNamed(context, '/changeTextColor');
                },
              ),
              RaisedButton(
                child: Text("ExpandedLayout"),
                onPressed: () {
                  Navigator.pushNamed(context, '/expandedLayout');
                },
              )
            ],
          ),
        ],
      ),
    );
  }
}
